<% if flash[:error] %>
<script>
    $('dialog_message_placeholder').innerHTML = '<%=flash[:error]%>'
</script>
<% else %>
<script>
    Dialog.closeInfo();
    flash_message('<%=flash[:notice]%>');
    image_controller.clear_batch();
</script>
<% end %>